import request from "../utils/request"//导入request实例对象
//将与服务端的交互代码放在api这一层
//查询员工
export const queryEmpApi = (name,gender,begin,end,page,pageSize)=>request.get(`/emps?name=${name}&gender=${gender}&begin=${begin}&end=${end}&page=${page}&pageSize=${pageSize}`)//箭头函数：若有返回值，可以简写将return和{}删掉

//新增员工
export const addEmpApi = (emp)=>request.post('/emps',emp)

//查询回显员工
export const queryByIdApi=(id)=>request.get(`/emps/${id}`)

//修改员工
export const updateEmpApi = (emp)=>request.put('/emps',emp)

//删除员工
export const deleteEmpApi=(ids)=>request.delete(`/emps?ids=${ids}`)

//查询所有员工
export const queryAllEmpApi=()=>request.get('/emps/list')